package Day2025_02_21;

/**
 * 饿汉模式
 */

public class SingletonHungry {
    private static SingletonHungry instance = new SingletonHungry();
    private SingletonHungry() {}

    public static SingletonHungry getInstance() {
        return instance;
    }

    public static void main(String[] args) {
        SingletonHungry singletonHungry = SingletonHungry.getInstance();
        singletonHungry.getInstance();
    }
}
